package cn.auto.service;

import cn.auto.common.model.User;
import cn.auto.utility.Status;

public class UserService {
	
	User user = new User();
	public String login(String uname, String psw) {
		String status = null;
		String password = user.getPassword(uname);
		try {
			if (psw.equals(password)) {
				status = Status.SUCCESS;
			} else if (password == null) {
				status = Status.NORECORD;
			} else {
				status = Status.FAILED;
			}
		} catch (Exception e) {
			// TODO: handle exception
			status = Status.UNKNOWN;
		}
		return status;
	}
	
	public User getUserInfo(String uname) {
		return (new User()).getUserInfo(uname);
	}

}
